<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <style>
    body {
      width: 400px;
      height: 500px;
      margin: 0;
      padding: 0;
      font-family: Arial, sans-serif;
    }
    
    .header {
      background-color: #4CAF50;
      color: white;
      padding: 15px;
      text-align: center;
      font-size: 18px;
      font-weight: bold;
    }
    
    .controls {
      padding: 10px;
      background-color: #f5f5f5;
      border-bottom: 1px solid #ddd;
      display: flex;
      justify-content: space-between;
    }
    
    button {
      background-color: #4CAF50;
      color: white;
      border: none;
      padding: 8px 12px;
      cursor: pointer;
      border-radius: 4px;
      font-size: 14px;
    }
    
    button:hover {
      background-color: #45a049;
    }
    
    button:disabled {
      background-color: #cccccc;
      cursor: not-allowed;
    }
    
    .video-list {
      height: 350px;
      overflow-y: auto;
    }
    
    .video-item {
      padding: 12px;
      border-bottom: 1px solid #eee;
    }
    
    .video-item:hover {
      background-color: #f9f9f9;
    }
    
    .video-title {
      font-weight: bold;
      margin-bottom: 5px;
      word-break: break-word;
    }
    
    .video-url {
      font-size: 12px;
      color: #666;
      margin-bottom: 8px;
      word-break: break-word;
    }
    
    .video-page {
      font-size: 11px;
      color: #999;
      margin-bottom: 10px;
    }
    
    .video-actions {
      display: flex;
      justify-content: flex-end;
    }
    
    .download-btn {
      background-color: #2196F3;
      padding: 6px 10px;
      font-size: 12px;
    }
    
    .download-btn:hover {
      background-color: #1976D2;
    }
    
    .empty-state {
      text-align: center;
      padding: 50px 20px;
      color: #666;
    }
    
    .empty-state img {
      width: 100px;
      height: 100px;
      opacity: 0.3;
      margin-bottom: 20px;
    }
    
    .status {
      padding: 10px;
      text-align: center;
      font-size: 14px;
      color: #666;
      border-top: 1px solid #ddd;
    }
  </style>
</head>
<body>
  <div class="header">
    HLS Video Detector
  </div>
  
  <div class="controls">
    <button id="refreshBtn">刷新</button>
    <button id="clearBtn">清空列表</button>
  </div>
  
  <div class="video-list" id="videoList">
    <div class="empty-state" id="emptyState">
      <div>🔍</div>
      <p>未检测到HLS视频</p>
      <p>浏览包含HLS视频的页面，然后点击刷新按钮</p>
    </div>
  </div>
  
  <div class="status">
    <span id="videoCount">0</span> 个视频已检测
  </div>
  
  <script src="popup.js"></script>
</body>
</html>